The present invention relates to a digital signal processing apparatus and a method for controlling the apparatus that allow for a fast operation in system control.
Generally in the field of system control such as servo control, efforts are made to minimize an error between an actual output and an expected target value provided from a device to be controlled. In recent years, a, digital signal processor (hereinafter abbreviated to D{overscore (S)}P) has been widely used, which accepts such an error as a digital value and performs operations on the digital value to generate an optimal manipulated variable for the device to be controlled.
Operations in some DSPs are implemented by hardware tailored to a particular use. However, many DSPs have a configuration in which the operations are controlled by a program. The DPS, like a microprocessor, performs processing according to a given program and is characterized by more sophisticated operations at higher speed than the microprocessor.
FIG. 5 shows an internal configuration of a conventional DSP. In FIG. 5, a program counter 2, in which any value can be set through an external bus 1, generates a read address of program memory 3 when a process by the DSP is activated. When a jump instruction is detected in an instruction decoder 4, the jump address is set in the program counter 2. Otherwise, the counter is incremented by one in synchronization with a system clock.
A program is written into the program memory 3 through the external bus 1 and a program word at the address output by the program counter 2 is output from the program memory 3.
When a process by the DSP is activated, the instruction decoder 4 interprets the program word provided from the program memory 3 and generates a control signal 9 for controlling internal components, a data memory store address provided to a delay unit 8, and a data memory read address for reading data X, Y to be input into an arithmetic and logic unit 6 from a data memory 5.
The control signal 9 is a signal for controlling the arithmetic and logic unit 6, data memory 5, and delay unit 8 in the DSP.
The delay unit 8 temporarily holds the data memory store address generated by the instruction decoder 4 and transfers it to the data memory 5 after a wait for a predetermined period of time.
The predetermined time period represents delay time until the arithmetic and logic unit 6 outputs resultant data of an operation specified by an instruction.
The data memory 5 is configured so as to be capable of storing data provided through the external bus 1 and has the capability of outputting data to the arithmetic and logic unit 6 according to the data memory read address and the capability of storing data output by the arithmetic and logic unit 6 according to the data memory store address provided from the delay unit 8.
The arithmetic and logic unit 6 has arithmetic capabilities for supporting operation instructions in a program stored in the program memory 3.
A MUX 7b selects the result of an operation performed by the arithmetic and logic unit 6 to transfer it to the data memory 5 when the result of the operation is written into the data memory 5 after the instruction decoder 4 detects an operation instruction, or selects an external status signal 10 to transfer it to the data memory 5 when the external status signal 10 is written into the data memory 5 after the instruction decoder 4 detects an external input instruction.
FIG. 6 shows an example of a process that requires time for processing other than operations in servo control processing. In FIG. 6, an error 11 is a difference between an actual output and an expected output from a device to be controlled. A manipulated variable 13 is information for operating the controlled device.
Because the error 11 is input into process A in certain cycles, the time for generating the manipulated variable 13 based on the error 11 is limited. The following process should be performed within the limited time.
First, in process A, an operation is performed based on the error 11 and one of the result of the operation and a value of variable 1 (Z1) is selected by a selection unit 12 and provided to process B.
Process B performs an operation based on the value selected by the selection unit 12, stores the intermediate result of the process 1 based on the result of the operation into variable 1 (Z1), and outputs the final result of the process 1 as a manipulated variable 13. Z1 input into the selection unit 12 is a value on which an operation was performed and stored in variable 1 by process 1 a cycle before.
The manipulated variable 13 calculated in the above-described method is used for driving the device to be controlled in such a way that the manipulated variable 13 is read through the external bus 1 and input into an output circuit such as a digital-analog converter, for example.
In the above-describe example, it is assumed that the external status signal 10 shown in FIG. 5 is a one-bit signal and that the output from process A is selected by the selection unit 12 shown in FIG. 6 if the external signal 10 is 0, or Z1 is selected by the selection unit 12 shown in FIG. 6 if the external status signal 10 is 1.
FIG. 7 shows part of a program flow in the case where the exemplary process shown in FIG. 6 is processed by the DSP shown in FIG. 5. The program flow, xe2x80x9cprocess Axe2x86x9221xe2x86x9222xe2x86x9223xe2x86x9224xe2x86x9225xe2x86x9226xe2x86x92process Bxe2x80x9d, in FIG. 7 embodies the flow, xe2x80x9cprocess Axe2x86x92selection unit 12xe2x86x92process Bxe2x80x9d shown in FIG. 6 and each of the instructions is transferred from the program memory 3 to the instruction decoder 4.
First, an external status signal 10 is stored at address K of the data memory 5 by the execution of the external input instruction 21. Then, the value at address K of the data memory 5 and a comparison value in an operand in the compare instruction 22 are transferred from the data memory 5 to the arithmetic and logic unit 6, where these values are compared. If they match, an address value existing in the data transfer instruction 26 is set in the program counter 2 by the execution of the conditional jump instruction 23, and then an output value process A is stored at address T of the data memory 5 by the execution of the data transfer instruction 26.
If the values do not match in the comparison process by the compare instruction 22, the program counter 2 is implemented by one, a value in variable 1 (Z1) is stored at address T of the data memory 5, an address value existing in process B is set in the program counter 2 by the execution of the jump instruction 25, then control is passed to process B.
In process B, an operation is performed based on the value stored at address T of the data memory 5. Thus, an input to process B is selected from one of the output value process A and variable Z1 according to the value of the external status signal 10. In this example, the longest path of the process by the selection unit 12 is xe2x80x9c21xe2x86x9222xe2x86x9223xe2x86x9224xe2x86x9225xe2x80x9d and the process requires at least five system clock cycles.
Furthermore, in this example, one value is selected out of the two values. If a value were to be selected out of N values, the number of instructions 27 in FIG. 7 would increase by Nxe2x88x922, increasing in the required amount of the program memory 3 and increasing the minimum time for processing by the selection unit 12 by 5xc3x97(Nxe2x88x922) system clock cycles. This overhead may cause shortage of time assigned to control process to be performed essentially.
However, a conventional DSP as described above takes time for the process of selecting a variable based on information provided externally in program processing and requires an increased amount of programs, increasing the required amount of program memory 3.
These problems inhibit an increase in processing speed and in addition, entails an increase in the size of LSI chips in developing the system LSIs containing the DSP, increasing power consumption and chip costs.
The present invention solves the above-mentioned problems and provides a digital signal processing apparatus and its control method, that allow for a reduction of circuit size to minimize an increase in power consumption and the costs of circuitry and an improvement in signal processing speed.
To solve the problems, the digital signal processing apparatus and its control method adds relatively small-sized circuits such as means for processing an external status signal or means for selecting condition determination data and a condition determination data selecting instruction decode capability.
That is, a digital signal processing apparatus according to claim 1 of the present invention is configured so as to comprise a program memory for storing a program, a program counter for reading an instruction from said program memory, an instruction decoder unit for outputting a control signal and an address according to the instruction read from said program memory, a delay unit for delaying the address output from said instruction decoder, data memory for outputting data based on the address output from said instruction decoder unit and storing data based on the address output from said delay unit, and an arithmetic and logic unit for performing an operation based on the data output from said data memory and transferring the result of the operation to said data memory, said apparatus being characterized by having external signal processing means for processing an external signal and means for selecting one of an output generated by said means and an output from said arithmetic and logic unit to store the selected output in said data memory.
A digital signal processing apparatus controlling method according to claim 2 is an method for controlling the digital in claim 1, comprising the steps of reading an external input instruction from the program memory according to an address generated by the program counter, decoding said external instruction and issuing an operation control signal, storing data processed by the external signal processing means according to said operation control signal, reading a multiply instruction from said program memory according to the address generated by said program counter, decoding said multiply instruction and issuing an operation control signal, multiplying data memory variable 1 available to be selected by said processed data according to said operation control signal and storing a result of the multiplication in said data memory, executing said multiply instruction to multiply data memory variable 2 available to be selected by said processed data and storing a result of the multiplication in said data memory, and executing an add instruction on said variable 1 and variable 2 and storing a result of the addition in said data memory as a result of selecting the external signal as a condition for determination.
A digital signal processing apparatus according to claim 3 is configured so as to comprise program memory for storing a program, a program counter for reading an instruction from said program memory, an instruction decoder unit for outputting a control signal and an address according to the instruction read from said program memory, a delay unit for delaying the address output from said instruction decoder, data memory for outputting data based on the address output from said instruction decoder unit and storing data based on the address output from said delay unit, and an arithmetic and logic unit for performing an operation based on the data output from said data memory and transferring the result of the operation to said data memory, said apparatus being characterized by having data selection means for determining a condition by using an external signal as information for the determination, and means having a condition determination data select instruction capability for causing said data selection means to be executed.
A digital signal processing apparatus controlling method according to claim 4 is an method for controlling the digital in claim 3, comprising the steps of reading the condition determination data select instruction from the program memory according to the address generated by the program counter, decoding said condition determination data selection instruction and issuing an operation control signal, reading data available to be selected by the data selection means from the data memory according to said operation control signal, transferring the data selected by said data selection means according to an external signal to said data memory, and storing said selected data in said data memory according to an address from the delay unit.
According to the configuration and method, the circuit arrangements and the amount of program memory that were conventionally required for executing a compare instruction, conditional jump instruction, and jump instruction can be reduced by adding relatively small-sized circuits such as means for processing an external status signal or means for selecting condition determination data and a condition determination data selection instruction selecting instruction decode capability.
In addition, data selection processing time required per control processing interval is reduced to increase the quantity of operation instructions essential to the control.
Thus, circuit size can be reduced to minimize an increase in power consumption and costs and signal processing speed can be improved.
When a control process is changed based on an external status during the execution of a program, the above-mentioned effects become remarkable especially as the number of external statuses, which are discrimination conditions for changing the control process, is increased.